$(function() {
	var driverstatistics = echarts.init(document.getElementById('driverstatistics'));
	option = {
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b}: {c} ({d}%)"
		},
		legend: {
			orient: 'vertical',
			x: 'left',
			data: ['在线司机', '不在线司机', '单位订单数']
		},
		series: [{
			name: '订单数量',
			type: 'pie',
			radius: ['50%', '70%'],
			avoidLabelOverlap: false,
			label: {
				normal: {
					show: false,
					position: 'center'
				},
				emphasis: {
					show: true,
					textStyle: {
						fontSize: '20',
						fontWeight: 'bold'
					}
				}
			},
			labelLine: {
				normal: {
					show: false
				}
			},
			data: [{
					value: 665,
					name: '在线司机'
				},
				{
					value: 335,
					name: '不在线司机'
				}
			]
		}]
	};
	driverstatistics.setOption(option);

	$('.driverstat').on('change', function() {
		if($(this).val() == 1) {
			$('.name').attr('type', 'text')
			$('.company').attr('type', 'hidden')
		} else {
			$('.name').attr('type', 'hidden')
			$('.company').attr('type', 'text')
		}
	})
	$('.timeclassify>button').on('click', function() {
		$(this).removeClass('am-btn-primary')
		$(this).addClass('am-btn-success')
		$(this).siblings().removeClass('am-btn-success')
		$(this).siblings().addClass('am-btn-primary')
	})
})